package com.xybc.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	static SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
	public static String dateToString(Date d) {
		return sdf.format(d);
	}
	public static Date stringToDate(String d) {
		try {
			return sdf.parse(d);
		} catch (ParseException e) {
			e.printStackTrace();
			return null;
		}
	}

}
